package sto.orz.json;

import net.sf.json.JSONObject;
import sto.orz.html.form.Form;

public class JSONForm implements JSONAdapter {
	private Form form;

	public JSONForm(Form form) {
		this.form = form;
	}

	public String toJson() {
		// form.getName();
		//
		// List<FormElement> elements = form.getElements();
		// for (FormElement element : elements) {
		// }
		// }
		java.util.HashMap<String,Form> j = new java.util.HashMap<String,Form>();
		j.put("form", form);
		JSONObject jsonObject = JSONObject.fromMap(j);
		String jsonString = jsonObject.toString();
		return jsonString;
	}

}
